home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -serious- / programming / e / powerd0.06 / modules / libraries / amigaguide.m next >
Text File  |  1999-11-30  |  6KB  |  186 lines

  1. MODULE    'exec/lists',
  2.             'exec/nodes',
  3.             'exec/semaphores',
  4.             'intuition/intuition',
  5.             'intuition/screens',
  6.             'intuition/classusr',
  7.             'dos/dos',
  8.             'utility/tagitem'
  9.  
  10. ENUM    APSH_TOOL_ID        =11000,
  11.         StartupMsgID        =APSH_TOOL_ID+1,
  12.         LoginToolID            =APSH_TOOL_ID+2,
  13.         LogoutToolID        =APSH_TOOL_ID+3,
  14.         ShutdownMsgID        =APSH_TOOL_ID+4,
  15.         ActivateToolID        =APSH_TOOL_ID+5,
  16.         DeactivateToolID    =APSH_TOOL_ID+6,
  17.         ActiveToolID        =APSH_TOOL_ID+7,
  18.         InactiveToolID        =APSH_TOOL_ID+8,
  19.         ToolStatusID        =APSH_TOOL_ID+9,
  20.         ToolCmdID            =APSH_TOOL_ID+10,
  21.         ToolCmdReplyID        =APSH_TOOL_ID+11,
  22.         ShutdownToolID        =APSH_TOOL_ID+12
  23.  
  24. ENUM    AGA_Dummy            =TAG_USER,
  25.         AGA_Path                =AGA_Dummy+1,
  26.         AGA_XRefList        =AGA_Dummy+2,
  27.         AGA_Activate        =AGA_Dummy+3,
  28.         AGA_Context            =AGA_Dummy+4,
  29.         AGA_HelpGroup        =AGA_Dummy+5,
  30.         AGA_Reserved1        =AGA_Dummy+6,
  31.         AGA_Reserved2        =AGA_Dummy+7,
  32.         AGA_Reserved3        =AGA_Dummy+8,
  33.         AGA_ARexxPort        =AGA_Dummy+9,
  34.         AGA_ARexxPortName    =AGA_Dummy+10,
  35.  
  36. struct AmigaGuideMsg
  37. {
  38.     struct Message     agm_Msg;            /* Embedded Exec message structure */
  39.     ULONG         agm_Type;            /* Type of message */
  40.     APTR         agm_Data;            /* Pointer to message data */
  41.     ULONG         agm_DSize;            /* Size of message data */
  42.     ULONG         agm_DType;            /* Type of message data */
  43.     ULONG         agm_Pri_Ret;            /* Primary return value */
  44.     ULONG         agm_Sec_Ret;            /* Secondary return value */
  45.     APTR         agm_System1;
  46.     APTR         agm_System2;
  47. };
  48.  
  49. /* Allocation description structure */
  50. struct NewAmigaGuide
  51. {
  52.     BPTR         nag_Lock;            /* Lock on the document directory */
  53.     STRPTR         nag_Name;            /* Name of document file */
  54.     struct Screen    *nag_Screen;            /* Screen to place windows within */
  55.     STRPTR         nag_PubScreen;            /* Public screen name to open on */
  56.     STRPTR         nag_HostPort;            /* Application's ARexx port name */
  57.     STRPTR         nag_ClientPort;        /* Name to assign to the clients ARexx port */
  58.     STRPTR         nag_BaseName;            /* Base name of the application */
  59.     ULONG         nag_Flags;            /* Flags */
  60.     STRPTR        *nag_Context;            /* NULL terminated context table */
  61.     STRPTR         nag_Node;            /* Node to align on first (defaults to Main) */
  62.     LONG         nag_Line;            /* Line to align on */
  63.     struct TagItem    *nag_Extens;            /* Tag array extension */
  64.     VOID        *nag_Client;            /* Private! MUST be NULL */
  65. };
  66.  
  67. /* public Client flags */
  68. #define    HTF_LOAD_INDEX        (1L<<0)            /* Force load the index at init time */
  69. #define    HTF_LOAD_ALL        (1L<<1)            /* Force load the entire database at init */
  70. #define    HTF_CACHE_NODE        (1L<<2)            /* Cache each node as visited */
  71. #define    HTF_CACHE_DB        (1L<<3)            /* Keep the buffers around until expunge */
  72. #define    HTF_UNIQUE        (1L<<15)        /* Unique ARexx port name */
  73. #define    HTF_NOACTIVATE        (1L<<16)        /* Don't activate window */
  74.  
  75. #define    HTFC_SYSGADS        0x80000000
  76.  
  77. /* Callback function ID's */
  78. #define    HTH_OPEN        0
  79. #define    HTH_CLOSE        1
  80.  
  81. #define    HTERR_NOT_ENOUGH_MEMORY        100L
  82. #define    HTERR_CANT_OPEN_DATABASE    101L
  83. #define    HTERR_CANT_FIND_NODE        102L
  84. #define    HTERR_CANT_OPEN_NODE        103L
  85. #define    HTERR_CANT_OPEN_WINDOW        104L
  86. #define    HTERR_INVALID_COMMAND        105L
  87. #define    HTERR_CANT_COMPLETE        106L
  88. #define    HTERR_PORT_CLOSED        107L
  89. #define    HTERR_CANT_CREATE_PORT        108L
  90. #define    HTERR_KEYWORD_NOT_FOUND        113L
  91.  
  92. typedef struct AmigaGuideHost *AMIGAGUIDEHOST;
  93.  
  94. /* Cross reference node */
  95. struct XRef
  96. {
  97.     struct Node         xr_Node;            /* Embedded node */
  98.     UWORD         xr_Pad;            /* Padding */
  99.     struct DocFile    *xr_DF;                /* Document defined in */
  100.     STRPTR         xr_File;            /* Name of document file */
  101.     STRPTR         xr_Name;            /* Name of item */
  102.     LONG         xr_Line;            /* Line defined at */
  103. };
  104.  
  105. #define    XRSIZE    (sizeof (struct XRef))
  106.  
  107. /* Types of cross reference nodes */
  108. #define    XR_GENERIC    0
  109. #define    XR_FUNCTION    1
  110. #define    XR_COMMAND    2
  111. #define    XR_INCLUDE    3
  112. #define    XR_MACRO    4
  113. #define    XR_STRUCT    5
  114. #define    XR_FIELD    6
  115. #define    XR_TYPEDEF    7
  116. #define    XR_DEFINE    8
  117.  
  118. /* Callback handle */
  119. struct AmigaGuideHost
  120. {
  121.     struct Hook         agh_Dispatcher;        /* Dispatcher */
  122.     ULONG         agh_Reserved;            /* Must be 0 */
  123.     ULONG         agh_Flags;
  124.     ULONG         agh_UseCnt;            /* Number of open nodes */
  125.     APTR         agh_SystemData;        /* Reserved for system use */
  126.     APTR         agh_UserData;            /* Anything you want... */
  127. };
  128.  
  129. /* Methods */
  130. #define    HM_FINDNODE    1
  131. #define    HM_OPENNODE    2
  132. #define    HM_CLOSENODE    3
  133. #define    HM_EXPUNGE    10        /* Expunge DataBase */
  134.  
  135. /* HM_FINDNODE */
  136. struct opFindHost
  137. {
  138.     ULONG MethodID;
  139.     struct TagItem *ofh_Attrs;        /*  R: Additional attributes */
  140.     STRPTR ofh_Node;            /*  R: Name of node */
  141.     STRPTR ofh_TOC;            /*  W: Table of Contents */
  142.     STRPTR ofh_Title;            /*  W: Title to give to the node */
  143.     STRPTR ofh_Next;            /*  W: Next node to browse to */
  144.     STRPTR ofh_Prev;            /*  W: Previous node to browse to */
  145. };
  146.  
  147. /* HM_OPENNODE, HM_CLOSENODE */
  148. struct opNodeIO
  149. {
  150.     ULONG MethodID;
  151.     struct TagItem *onm_Attrs;        /*  R: Additional attributes */
  152.     STRPTR onm_Node;            /*  R: Node name and arguments */
  153.     STRPTR onm_FileName;        /*  W: File name buffer */
  154.     STRPTR onm_DocBuffer;        /*  W: Node buffer */
  155.     ULONG onm_BuffLen;            /*  W: Size of buffer */
  156.     ULONG onm_Flags;            /* RW: Control flags */
  157. };
  158.  
  159. /* onm_Flags */
  160. #define    HTNF_KEEP    (1L<<0)    /* Don't flush this node until database is
  161.                  * closed. */
  162. #define    HTNF_RESERVED1    (1L<<1)    /* Reserved for system use */
  163. #define    HTNF_RESERVED2    (1L<<2)    /* Reserved for system use */
  164. #define    HTNF_ASCII    (1L<<3)    /* Node is straight ASCII */
  165. #define    HTNF_RESERVED3    (1L<<4)    /* Reserved for system use */
  166. #define    HTNF_CLEAN    (1L<<5)    /* Remove the node from the database */
  167. #define    HTNF_DONE    (1L<<6)    /* Done with node */
  168.  
  169. /* onm_Attrs */
  170. #define    HTNA_Dummy    (TAG_USER)
  171. #define    HTNA_Screen    (HTNA_Dummy+1)    /* (struct Screen *) Screen that window resides in */
  172. #define    HTNA_Pens    (HTNA_Dummy+2)    /* Pen array (from DrawInfo) */
  173. #define    HTNA_Rectangle    (HTNA_Dummy+3)    /* Window box */
  174.  
  175. #define    HTNA_HelpGroup    (HTNA_Dummy+5)    /* (ULONG) unique identifier */
  176.  
  177.  
  178. /* HM_EXPUNGE */
  179. struct opExpungeNode
  180. {
  181.     ULONG MethodID;
  182.     struct TagItem *oen_Attrs;        /*  R: Additional attributes */
  183. };
  184.  
  185. #endif /* LIBRARIES_AMIGAGUIDE_H */
  186.